package UserInterface;

import FlightInfo.FlightStatus;
import FlightInfo.Flights;
import InterfacesAndModules.DataOperationInterface;
import NewAirportInfo.AirportBasicInfo;

import java.util.ArrayList;
import java.util.Scanner;

public final class UserInterface {
    public void MainInUserInterface(ArrayList<Flights>PassInFlights, ArrayList<FlightStatus>PassInFlightStatus, ArrayList<AirportBasicInfo>PassInAirport) {
        System.out.println("欢迎使用此系统");
        if(PassInAirport.isEmpty()){
            /*临时初始化，离开作用域后就del掉初始化器，省内存*/
            System.out.println("机场信息未初始化，请初始化机场信息");
            InitializeAirportInfo Initer = new InitializeAirportInfo();//初始化器Initer
            Initer.InitializeAirport(PassInAirport);//调用初始化对象
        }
        /*预留机场选择模块*/
        DataOperationInterface Doi = new DataOperationInterface();
        AirportBasicInfo Airport = Doi.GetAirportBasicInfo(PassInAirport,0);
        /*预留结束*/
        System.out.println("欢迎使用 " + Airport.ThisAirportName + " 数字化管理系统");
        System.out.println("您的登录身份是");
        System.out.println("1.飞行员   2.管制员   3.我想跑路");
        UserInputIsSure IsSure = new UserInputIsSure();
        int UserChoice;
        Scanner UserInputer = new Scanner(System.in);
        UserChoice = UserInputer.nextInt();
        UserChoice = IsSure.UsingCorrectNumInputIsCorrect(1,3,UserChoice);
        if (UserChoice == 1) {
            UserIsPilot Pilot = new UserIsPilot();
            Pilot.UserIsPilot(PassInAirport, PassInFlights, PassInFlightStatus);
        }
    }
}
